"""API v1 router aggregator."""

from __future__ import annotations

import os

from fastapi import APIRouter

from app.api.v1.endpoints import (
    alarms,
    auth,
    data_collection,
    performance,
    projects,
    smart_import,
    statistics,
    trends,
)


api_router = APIRouter()

# Register auth endpoints
api_router.include_router(auth.router, prefix="/auth", tags=["auth"])

# Register project endpoints
api_router.include_router(projects.router, prefix="/projects", tags=["projects"])

# Register data collection endpoints
api_router.include_router(data_collection.router, prefix="/data-collection", tags=["data-collection"])

# Register smart import endpoints
api_router.include_router(smart_import.router, prefix="/smart-import", tags=["smart-import"])

# Register alarm endpoints
api_router.include_router(alarms.router, prefix="/alarms", tags=["alarms"])

# Register performance monitoring endpoints
api_router.include_router(performance.router, prefix="/performance", tags=["performance"])

# Register statistics endpoints
api_router.include_router(statistics.router, prefix="/statistics", tags=["statistics"])

# Register trend analysis endpoints
api_router.include_router(trends.router, prefix="/trends", tags=["trends"])

# Register test helpers (only in test/dev environment)
IS_TEST_ENV = os.getenv("ENVIRONMENT", "development") in ["test", "development"]
if IS_TEST_ENV:
    from app.api.v1.endpoints import test_helpers

    api_router.include_router(test_helpers.router, prefix="/test", tags=["test-helpers"])
